package com.heying.springcore.aop.jdbc.service.jdbc;

import com.heying.springcore.aop.jdbc.entity.StudentInfo;
import com.heying.springcore.aop.jdbc.repository.jdbc.JdbcStudentRepository;
import com.heying.springcore.aop.jdbc.repository.StudentRepository;
import com.heying.springcore.aop.jdbc.service.StudentService;
import org.springframework.stereotype.Service;

import javax.inject.Inject;

@Service
public class JdbcStudentService implements StudentService {

    private StudentRepository studentRepository;

    @Inject
    public JdbcStudentService(JdbcStudentRepository studentRepository) {
        this.studentRepository = studentRepository;
    }

    @Override
    public void insertOne(StudentInfo studentInfo){
        studentRepository.insertOne(studentInfo);
    }

    @Override
    public StudentInfo queryByStuno(String stuno) {
        return studentRepository.queryByStuno(stuno);
    }

    @Override
    public StudentInfo queryStuAndClassByStuno(String stuno) {
        return studentRepository.queryStuAndClassByStuno(stuno);
    }

}
